const routes = [
    {path: "/", component: () => import("/assets/vue/home/home.js")},
    {path: "/PTSG/germ/germPage", component: () => import("/assets/vue/germ/germplasm.js")},
    {path: "/PTSG/germ/germInfo/:id", component: () => import("/assets/vue/germ/germInfo.js"), props: true},
    {path: "/PTSG/taxomony/treePage", component: () => import("/assets/vue/taxomony/tree.js"), props: true},

    {path: "/PTSG/map/mapPage", component: () => import("/assets/vue/map/geographical.js")},

    {path: "/PTSG/search/searchPage", component: () => import("/assets/vue/search/search.js")},

    {path: "/PTSG/news/newsPage", component: () => import("/assets/vue/news/news.js")},

    {path: "/PTSG/user/loginPage", component: () => import("/assets/vue/user/login.js")},


    {path: "/PTSG/blank/:title", component: () => import("/assets/vue/blank/blank.js"), props: true}
]

const router = VueRouter.createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: VueRouter.createWebHashHistory(),
    routes // `routes: routes` 的缩写
})

router.beforeEach((to, from, next) => {
    NProgress.start();
    next()
});

router.afterEach(transition => {
    NProgress.done();
});

export default router;